package com.smart.web.controller.system;


import com.smart.common.core.domain.R;
import com.smart.system.service.IFfmpegService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.bytedeco.javacv.FrameGrabber;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.imageio.ImageIO;

@RestController
@RequestMapping("/cast")
@Api(tags = "流转换")
public class CastStreamController {

    @Autowired
    private IFfmpegService ffmpegService;

    @ApiOperation(value = "开始转换")
    @GetMapping("startCast")
    public R startCast(){
        ffmpegService.start("1","1");
        ffmpegService.start("1","2");
        ffmpegService.start("1","3");
        return R.ok();
    }

    @ApiOperation(value = "停止转换")
    @GetMapping("stopCast")
    public R stopCast(){
        ffmpegService.stop("1","1");
        ffmpegService.stop("1","2");
        ffmpegService.stop("1","3");
        return R.ok();
    }
}


